﻿Imports System.Data.SqlClient

Public Class frmMain

    Dim SignedOut As Boolean

    Private Sub ManageChartOfAccountsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MC1.Click
        Dim a As New frmChartofAccountsMng
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub PrintvoucherToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PrintvoucherToolStripMenuItem1.Click
        Dim a As New frmVoucherPrint
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub AccountsStatementsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AccountsStatementsToolStripMenuItem.Click
        Dim a As New frmAccountStatement
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub TrialBalanceToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrialBalanceToolStripMenuItem.Click
        Dim a As New frmTrialBalance
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub ToolStripMenuItem6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem6.Click
        Dim a As New frmProfitandLoss
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub CashFlowToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CashFlowToolStripMenuItem.Click
        Dim a As New frmCashFlow
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub JournalRegisterToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles JournalRegisterToolStripMenuItem.Click
        Dim a As New frmListofVouchers
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub BudgetToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MC8.Click
        Dim a As New frmFinancialBudget
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub ToolStripMenuItem10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MC7.Click
        Dim a As New frmVoucherReverse
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub UserAccountsManagementToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MUsersMang.Click
        Dim a As New frmUsersMang
        a.MdiParent = Me
        a.Show()
    End Sub

    Sub CheckExpiringPolicies()
        Try
            Me.Cursor = Cursors.WaitCursor

            Dim cmd As New SqlCommand("Select IsNull(Count(*),0) From Policies " & _
                                      "Where (DateDiff(Day,GetDate(),PeriodTo) Between 0 and 45) and (EndorsNo=N'')", cnn)
            Dim X As Integer


            cnn.Open()
            X = CInt(cmd.ExecuteScalar)
            cnn.Close()

            If X > 0 Then
                Me.AlertExpPolicies.CaptionText = "Expiring Policies"
                Me.AlertExpPolicies.ContentText = "(" & X & ") Policies will be expired within 45 days"

                Me.AlertExpPolicies.Hide()
                Me.AlertExpPolicies.Show()

            Else
                Me.AlertExpPolicies.Hide()
            End If

            Me.Cursor = Cursors.Default
        Catch ex As Exception
            Me.Cursor = Cursors.Default
            If cnn.State = ConnectionState.Open Then
                cnn.Close()
            End If
            MsgBox(ex.ToString)
        End Try
    End Sub

    Sub CheckPaymentsDue()
        Try
            Me.Cursor = Cursors.WaitCursor

            Dim cmd As New SqlCommand("Select IsNull(Count(*),0) From PaymentsSchedule Where " & _
                                      "(TransNo In (Select SNo From Policies)) and (DATEDIFF(Day, GETDATE(), PayDate) Between 0 and 60)", cnn)
            Dim X As Integer


            cnn.Open()
            X = CInt(cmd.ExecuteScalar)
            cnn.Close()

            If X > 0 Then
                Me.AlertPaymentsDue.CaptionText = "Payments Due"
                Me.AlertPaymentsDue.ContentText = "(" & X & ") Payments due within 60 days"

                Me.AlertPaymentsDue.Hide()
                Me.AlertPaymentsDue.Show()

            Else
                Me.AlertPaymentsDue.Hide()
            End If

            Me.Cursor = Cursors.Default
        Catch ex As Exception
            Me.Cursor = Cursors.Default
            If cnn.State = ConnectionState.Open Then
                cnn.Close()
            End If
            MsgBox(ex.ToString)
        End Try
    End Sub

    Private Sub frmMain_FormClosing(sender As Object, e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        Me.Timer1.Stop()
        Me.AlertExpPolicies.Hide()
        Me.AlertPaymentsDue.Hide()

        'If Sign Out is clicked
        If SignedOut = True Then
            Exit Sub
        End If

        If MsgBox("Are you sure you want to exit?", MsgBoxStyle.YesNo) = DialogResult.Yes Then
            End
        Else
            e.Cancel = True
        End If
    End Sub

    Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Try
            Me.LableUser.Text = "Current User: " & CurrentUser
            Me.lblBranch.Text = "Branch: " & Branch
            Me.Text += " v. " & My.Application.Deployment.CurrentVersion.ToString
        Catch ex As Exception

        End Try

        Me.Timer1.Start()

        CheckExpiringPolicies()
        CheckPaymentsDue()

        Try
            Me.Cursor = Cursors.WaitCursor

            Dim cmd As New SqlCommand("Select * From Users where SNo=" & CurrentUserID, cnn)
            Dim Reader As SqlDataReader

            cnn.Open()
            Reader = cmd.ExecuteReader
            While Reader.Read
                'Main Btns
                Me.MProduction.Enabled = CBool(Reader.Item("ChProduction"))
                ClientsProfiles = Reader.Item("ClientsProfile")
                ClientsProfilesAdmin = CBool(Reader.Item("ChClientsRegistryAdmin"))
                MClientsRegistry.Enabled = CBool(Reader.Item("ChClientsRegistryAdmin"))
                Me.MMasterTables.Enabled = CBool(Reader.Item("ChMasterTabels"))
                Me.MClaims.Enabled = CBool(Reader.Item("ChClaims"))
                Me.MFinance.Enabled = CBool(Reader.Item("ChFinance"))
                Me.MSales.Enabled = CBool(Reader.Item("ChSales"))
                Me.ChHR.Enabled = CBool(Reader.Item("ChHR"))
                Me.MUsersMang.Enabled = CBool(Reader.Item("ChUsersMang"))

                'Production
                Me.MProdRetail.Enabled = CBool(Reader.Item("ChProdRetail"))
                Me.CHProdIndividual.Enabled = CBool(Reader.Item("CHProdIndividual"))
                Me.CHProdApprove.Enabled = CBool(Reader.Item("ChProdEntryApproval"))
                Me.CHProdFinancialApprove.Enabled = CBool(Reader.Item("CHProdFinancialApprove"))
                Me.MProdReports.Enabled = CBool(Reader.Item("ChProdReports"))
                Me.MProdTargets.Enabled = CBool(Reader.Item("ChProdTargets"))

                'Sales
                Me.ChProspReAssign.Enabled = CBool(Reader.Item("ChProspReAssign"))
                Me.ChProspMangFollowUp.Enabled = CBool(Reader.Item("ChProspMangFollowUp"))
                Me.ChProspReport.Enabled = CBool(Reader.Item("ChProspReport"))
                Me.ChRenewAssign.Enabled = CBool(Reader.Item("ChRenewAssign"))
                Me.ChRenewMangFollowUp.Enabled = CBool(Reader.Item("ChRenewMangFollowUp"))
                Me.ChRenewReport.Enabled = CBool(Reader.Item("ChRenewReport"))
                Me.CHSlipMng.Enabled = CBool(Reader.Item("CHSlipMng"))

                'HR
                Me.ChStaffProfiles.Enabled = CBool(Reader.Item("CHStaffProfiles"))
                Me.ChAbsence.Enabled = CBool(Reader.Item("CHAbsence"))
                Me.ChIncidents.Enabled = CBool(Reader.Item("ChIncidents"))
                Me.ChIssueFormalLetters.Enabled = CBool(Reader.Item("ChIssueFormalLetters"))
                Me.ChWarningLetters.Enabled = CBool(Reader.Item("CHWarningLetters"))
                Me.CHJobMng.Enabled = CBool(Reader.Item("CHJobMng"))
                Me.ChVacationMng.Enabled = CBool(Reader.Item("ChVacationMng"))
                Me.ChAppraisal.Enabled = CBool(Reader.Item("ChAppraisal"))
                Me.CHPayroll.Enabled = CBool(Reader.Item("CHPayroll"))
                Me.CHHRSettings.Enabled = CBool(Reader.Item("CHHRSettings"))


                'Finance
                Me.MFinanceEntryApproval.Enabled = CBool(Reader.Item("ChFinanceEntryApproval"))
                Me.MFinanceRenameAccounts.Enabled = CBool(Reader.Item("ChFinanceRenameAccounts"))

            End While
            cnn.Close()

            Me.Cursor = Cursors.Default
        Catch ex As Exception
            Me.Cursor = Cursors.Default
            MsgBox(ex.ToString)
            If cnn.State = ConnectionState.Open Then
                cnn.Close()
            End If
            End
        End Try
    End Sub

    Private Sub ChangePassowrdToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ChangePassowrdToolStripMenuItem.Click
        Dim a As New frmChangePassword
        a.Show()
    End Sub

    Private Sub IssuedPoliciesToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles IssuedPoliciesToolStripMenuItem.Click
        Dim a As New frmProductionStatement
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub ExpiringPoliciesToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExpiringPoliciesToolStripMenuItem.Click
        Dim a As New frmExpiringPolicies
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub CommissionsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CommissionsToolStripMenuItem.Click
        Dim a As New frmProductionStatistics
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub ToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MClaims.Click
        Dim a As New frmMainClaims
        a.Show()
    End Sub

    Private Sub CarsMakeToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CarsMakeToolStripMenuItem.Click
        Dim a As New frmCarsMake
        a.Show()
    End Sub

    Private Sub ExchangeRatesToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExchangeRatesToolStripMenuItem.Click
        Dim a As New frmExchangeRatesRegistry
        a.Show()
    End Sub

    Private Sub ClaimsRejectionReasonsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ClaimsRejectionReasonsToolStripMenuItem.Click
        Dim a As New frmClaimsRejectionList
        a.Show()
    End Sub

    Private Sub btnAlert_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAlert.Click
        Try
            Me.Cursor = Cursors.WaitCursor

            Dim dap As New SqlDataAdapter("Select ClientNo,ClientName,InsurComp,PolicyNo,ClassName," & _
                                               "IssueDate,PeriodFrom,PeriodTo,ClassName,SumInsur,TotalPremium,CompComm,Department " & _
                                               "From Policies Where (DateDiff(Day,GetDate(),PeriodTo) Between 0 and 45) " & _
                                               "and (EndorsNo=N'')", cnn)
            Dim das As New DataSet

            cnn.Open()
            dap.Fill(das, "Policies")
            cnn.Close()

            Dim rpt As New ExpiringPolicies
            rpt.SetDataSource(das)
            rptViewer.CrystalReportViewer1.ReportSource = rpt
            rptViewer.CrystalReportViewer1.RefreshReport()
            rptViewer.ShowDialog()

            Me.Cursor = Cursors.Default
        Catch ex As Exception
            Me.Cursor = Cursors.Default
            If cnn.State = ConnectionState.Open Then
                cnn.Close()
            End If
            MsgBox(ex.ToString)
        End Try
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        CheckExpiringPolicies()
        CheckPaymentsDue()
    End Sub

    Private Sub btnAlertPaymentsDue_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAlertPaymentsDue.Click
        Try
            Me.Cursor = Cursors.WaitCursor

            Dim dap As New SqlDataAdapter("Select * From Policies Where SNo In (Select TransNo From PaymentsSchedule Where " & _
                                          "(TransNo In (Select SNo From Policies)) and (DATEDIFF(Day, GETDATE(), PayDate) Between 0 and 60))", cnn)

            Dim dap1 As New SqlDataAdapter("Select * From PaymentsSchedule Where " & _
                                           "(TransNo In (Select SNo From Policies)) and (DATEDIFF(Day, GETDATE(), PayDate) Between 0 and 60)", cnn)
            Dim das As New Policies

            dap.Fill(das, "Policies")
            dap1.Fill(das, "PaymentsSchedule")

            Dim rpt As New PaymentsDue
            rpt.SetDataSource(das)
            rptViewer.CrystalReportViewer1.ReportSource = rpt
            rptViewer.CrystalReportViewer1.RefreshReport()
            rptViewer.ShowDialog()

            Me.Cursor = Cursors.Default
        Catch ex As Exception
            Me.Cursor = Cursors.Default
            If cnn.State = ConnectionState.Open Then
                cnn.Close()
            End If
            MsgBox(ex.ToString)
        End Try
    End Sub

    Private Sub MakePayVoucherToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MakePayVoucherToolStripMenuItem.Click
        Dim a As New frmMakePayment
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub JournalVouchersToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles JournalVouchersToolStripMenuItem.Click
        Dim a As New frmApproveJournalVoucher
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub MakeJournalVoucherToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MakeJournalVoucherToolStripMenuItem.Click
        Dim a As New frmMakeJournalVoucher
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub MakeReceiptVoucherToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles MakeReceiptVoucherToolStripMenuItem.Click
        Dim a As New frmMakeReceipt
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub PayVouchersToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles PayVouchersToolStripMenuItem.Click
        Dim a As New frmApprovePayVoucher
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub ReceiptVoucherToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles ReceiptVoucherToolStripMenuItem.Click
        Dim a As New frmApproveReceiptVoucher
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub DataLockToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles DataLockToolStripMenuItem.Click
        Dim a As New frmDataLock
        a.Show()
    End Sub

    Private Sub ArchiveToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles ArchiveToolStripMenuItem.Click
        Dim a As New frmArchivePayVouchers
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub ArchiveToolStripMenuItem1_Click(sender As System.Object, e As System.EventArgs) Handles ArchiveToolStripMenuItem1.Click
        Dim a As New frmArchiveReceiptVouchers
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub InsuranceBrokersRegistryToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles InsuranceBrokersRegistryToolStripMenuItem.Click
        Dim a As New frmInsuranceBrokersRegistry
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub ProspectLossReasonsToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles ProspectLossReasonsToolStripMenuItem.Click
        Dim a As New frmProspectLossReasons
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub ToolStripMenuItem10_Click_1(sender As System.Object, e As System.EventArgs) Handles MClientsRegistry.Click
        Dim a As New frmClientRegistry
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub ToolStripMenuItem12_Click(sender As System.Object, e As System.EventArgs) Handles ToolStripMenuItem12.Click
        Dim a As New frmChartOfAccountsTranslation
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub IndemnityTargetBudgetToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles IndemnityTargetBudgetToolStripMenuItem.Click
        Dim a As New frmTargetCompany
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub StaffTargetToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles StaffTargetToolStripMenuItem.Click
        Dim a As New frmTargetStaff
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub ProspectsRegistryToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles ProspectsRegistryToolStripMenuItem.Click
        Dim a As New frmProspectsRegistry
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub ReassignProspectsToSalesAgentsToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles ChProspReAssign.Click
        Dim a As New frmProspectsReassign
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub ChProspMangFollowUp_Click(sender As System.Object, e As System.EventArgs) Handles ChProspMangFollowUp.Click
        Dim a As New frmProspectsMangFollowUp
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub ArchiveToolStripMenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CHProspectArchive.Click
        Dim a As New frmProspectsArchive
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub ChRenwAssign_Click(sender As System.Object, e As System.EventArgs) Handles ChRenewAssign.Click
        Dim a As New frmRenewalsAssign
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub ActiveRenewalsFollowUpToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles ChRenewMangFollowUp.Click
        Dim a As New frmRenewalsFollowUp
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub StaffProfilesToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles ChStaffProfiles.Click
        Dim a As New frmStaffProfilesRegistry
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub ReligionsToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles ReligionsToolStripMenuItem.Click
        Dim a As New frmListReligion
        a.ShowDialog()
    End Sub

    Private Sub JobTitlesToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles JobTitlesToolStripMenuItem.Click
        Dim a As New frmListJobTitles
        a.ShowDialog()
    End Sub

    Private Sub NationalitiesToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles NationalitiesToolStripMenuItem.Click
        Dim a As New frmListNationality
        a.ShowDialog()
    End Sub

    Private Sub ChProspReport_Click(sender As System.Object, e As System.EventArgs) Handles ChProspReport.Click
        'Dim a As New frmProspectsReports
        'a.MdiParent = Me
        'a.Show()
        Dim a As New frmSalesReport
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub ChIncidents_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ChIncidents.Click
        Dim a As New frmStaffIncidents
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub ChAbsence_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ChAbsence.Click
        Dim a As New frmStaffAbsence
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub ToolStripMenuItem10_Click_2(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem10.Click
        Dim a As New frmStaffLeave
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub ClearenceCertificateToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ClearenceCertificateToolStripMenuItem.Click
        Dim a As New frmClearanceCertificate
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub DisclamerLetterToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Dim a As New frmDisclaimerLetter
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub EmploymentLetterToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Dim a As New frmEmploymentLetter
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub IncuranceClassesListToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles IncuranceClassesListToolStripMenuItem.Click
        Dim a As New frmInsuranceClasses
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub ToolStripMenuItem3_Click(sender As System.Object, e As System.EventArgs) Handles ToolStripMenuItem3.Click
        Dim a As New frmEditJournalVoucher
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub ToolStripMenuItem14_Click(sender As System.Object, e As System.EventArgs) Handles ToolStripMenuItem14.Click
        Dim a As New frmEditPayVoucher
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub ToolStripMenuItem9_Click(sender As System.Object, e As System.EventArgs) Handles ToolStripMenuItem9.Click
        Dim a As New frmEditReceiptVoucher
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub MFinanceRenameAccounts_Click(sender As System.Object, e As System.EventArgs) Handles MFinanceRenameAccounts.Click
        Dim a As New frmRenameAccounts
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub VacationBalancesToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles VacationBalancesToolStripMenuItem.Click
        Dim a As New frmVacationBalances
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub StaffPlanToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles StaffPlanToolStripMenuItem.Click
        Dim a As New frmStaffleavePlan
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub ToolStripMenuItem13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CHPayroll.Click
        Dim a As New frmPayroll
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub MakeNewToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles MakeNewToolStripMenuItem.Click
        Dim a As New frmAppraisalForm
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub ArchiveToolStripMenuItem4_Click(sender As System.Object, e As System.EventArgs) Handles ArchiveToolStripMenuItem4.Click
        Dim a As New frmAppraisalFormArchive
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub ToolStripMenuItem16_Click(sender As System.Object, e As System.EventArgs) Handles ToolStripMenuItem16.Click
        Dim a As New frmEffectiveDateNotice
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub PoliciesEndorsmentsManagementToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CHProdPolicies.Click
        Dim a As New frmCorporateProduction
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub EntryApprovalToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CHProdApprove.Click
        Dim a As New frmCorporateProductionApproval
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub ToolStripMenuItem17_Click(sender As System.Object, e As System.EventArgs) Handles ToolStripMenuItem17.Click
        Dim a As New frmInsuranceCompanies
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub ToolStripMenuItem8_Click(sender As System.Object, e As System.EventArgs) Handles ToolStripMenuItem8.Click
        Dim a As New frmProducersRegistery
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub SignOutToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles SignOutToolStripMenuItem.Click
        If MsgBox("Are you sure you want to exit?", MsgBoxStyle.YesNo) = DialogResult.Yes Then
            SignedOut = True
            Dim a As New frmLogin
            a.Show()
            Me.Close()
        End If
    End Sub

    Private Sub ToolStripMenuItem18_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem18.Click
        Dim a As New frmProspectsCases
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub LibraryToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles LibraryToolStripMenuItem.Click
        Dim a As New frmHRLettersLibrary
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub EntryApprovalFinancialDepartmentToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CHProdFinancialApprove.Click
        Dim a As New frmCorporateProductionApprovalFinancial
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub ToolStripMenuItem19_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CHJobMng.Click
        Dim a As New frmJobOffers
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub FinancialSettingsToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles FinancialSettingsToolStripMenuItem.Click
        Dim a As New frmFinancialSettings
        a.ShowDialog()
    End Sub

    Private Sub SlipsManagementToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles CHSlipMng.Click
        Dim a As New frmSlipsManagement
        a.MdiParent = Me
        a.Show()
    End Sub

    Private Sub ToolStripMenuItem1_Click_1(sender As System.Object, e As System.EventArgs) Handles ToolStripMenuItem1.Click
        Dim a As New frmRFQ
        a.MdiParent = Me
        a.Show()
    End Sub
End Class
